// 组织信息

import request from '@/assets/common/js/utils/request';



/**
 * @description 获取人员信息
 * @param not
 * @return not
 * @author qiankui 2023-4-24 19:20:29
 **/
export function personnelinfoGetlist(data) {
    return request({
        url: 'personnelinfo/getlist',
        method: 'post',
        data: data,
    });
}

/**
 * @description 处理设备获取人员冲突项
 * @param not
 * @return not
 * @author qiankui 2023-9-13 14:16:09
 **/
export function personnelinfoDealpersonimportconfilcts(data) {
    return request({
        url: 'personnelinfo/dealpersonimportconfilcts',
        method: 'post',
        data: data,
    });
}
/**
 * @description 获取部门人员树
 * @param not
 * @return not
 * @author qiankui 2023-4-24 09:39:40
 **/
export function getdepartmenttree(data) {
    return request({
        url: 'departmentinfo/getdepartmenttree',
        method: 'get',
        params: data
    });
}
/**
 * @description 密码加密
 * @param not
 * @return not
 * @author qiankui 2024-6-4 15:07:53
 **/
export function personnelinfoEncryppassword(data) {
    return request({
        url: 'personnelinfo/encryppassword',
        method: 'get',
        params: data
    });
}



/**
 * @description 删除组织数据
 * @param not
 * @return not
 * @author qiankui 2023-4-24 14:02:45
 **/
export function departmentinfoDeletedepartment(data) {
    return request({
        url: `departmentinfo/deletedepartment`,
        method: 'POST',
        data: data,
    });
}
/**
 * @description 导出人员信息到Excel
 * @param not
 * @return not
 * @author qiankui 2023-4-24 09:39:40
 **/
export function exportpersoninfotoexcel(data) {
    return request({
        url: 'personnelinfo/exportpersoninfotoexcel',
        method: 'post',
        data: data,
        responseType: "arraybuffer"
    });
}
/**
 * @description 添加组织
 * @param not
 * @return not
 * @author qiankui 2023-4-24 19:20:29
 **/
export function departmentinfoCreate(data) {
    return request({
        url: 'departmentinfo/create',
        method: 'post',
        data: data,
    });
}
/**
 * @description 更新组织
 * @param not
 * @return not
 * @author qiankui 2023-4-25 10:23:55
 **/
export function departmentinfoUpdate(data) {
    return request({
        url: `departmentinfo/update/${data.id}`,
        method: 'put',
        data: data,
    });
}
/**
 * @description 更新人员信息
 * @param not
 * @return not
 * @author qiankui 2023-4-25 10:23:55
 **/
export function personnelinfoUpdate(data) {
    return request({
        url: `personnelinfo/update/${data.id}`,
        method: 'put',
        data: data,
    });
}
/**
 * @description 添加人员
 * @param not
 * @return not
 * @author qiankui 2023-4-25 09:50:06
 **/
export function personnelinfoCreate(data) {
    return request({
        url: 'personnelinfo/create',
        method: 'post',
        data: data,
    });
}
/**
 * @description 批量删除人员
 * @param not
 * @return not
 * @author qiankui 2023-4-25 09:50:06
 **/
export function personnelinfoBatchdelete(data) {
    return request({
        url: 'personnelinfo/batchdelete',
        method: 'post',
        data: data,
    });
}
/**
 * @description 清空人员
 * @param not
 * @return not
 * @author qiankui 2023-9-7 17:47:29
 **/
export function personnelinfoCleanallperson(data) {
    return request({
        url: 'personnelinfo/cleanallperson',
        method: 'post',
        data: data,
    });
}
/**
 * @description 删除人员
 * @param not
 * @return not
 * @author qiankui 2023-4-25 09:50:20
 **/
export function personnelinfoDelete(data) {
    return request({
        url: `personnelinfo/delete/?id=${data.id}`,
        method: 'DELETE',
    });
}
/**
 * @description 将本地文件转成Base64，保存时使用，无损转换，界面显示请使用file/imageconverttobase64，可以显示jp2和jpg
 * @param not
 * @return not
 * @author qiankui 2023-4-27 09:48:19
 **/
export function fileFiletobase64(data) {
    var  form = new FormData();
    // form.append("api-version",1)
    form.append("filePath",data.filePath)
    return request({
        url: '/file/filetobase64',
        method: 'post',
        data: form,
    });
}
/**
 * @description 获取导入人员Excel模板
 * @param not
 * @return not
 * @author qiankui 2023-5-4 16:29:56
 **/
export function personnelinfoGetexportpersoninfotoexcelteamplate() {
    return request({
        url: 'personnelinfo/getexportpersoninfotoexcelteamplate',
        method: 'get',
        responseType: "arraybuffer"
        // params: data,
        // responseType: "arraybuffer"
    });
}
/**
 * @description 将本地文件转成Base64
 * @param not
 * @return not
 * @author qiankui 2023-4-27 09:48:19
 **/
export function personnelinfoImportpersoninfo(filePath) {
    var  form = new FormData();
    form.append("filePath",filePath)
    return request({
        url: 'personnelinfo/importpersoninfo',
        method: 'post',
        data: form,
    });
}

/**
 * @description 批量导入人员生物信息
 * @param not
 * @return not
 * @author qiankui 2023-5-5 15:45:14
 **/
export function personnelinfoImportpersonbiodatainfo(data) {
    return request({
        url: 'personnelinfo/importpersonbiodatainfo',
        method: 'post',
        data: data,
    });
}
/**
 * @description 发送人员信息到设备（下发页面的保存按钮）
 * @param not
 * @return not
 * @author qiankui 2023-5-9 16:30:59
 **/
export function personnelinfoSendpersondata(data) {
    return request({
        url: 'personnelinfo/sendpersondata',
        method: 'post',
        data: data,
    });
}
/**
 * @description 根据设备编号列表获取人员名单信息
 * @param not
 * @return not
 * @author qiankui 2023-5-9 16:53:27
 **/
export function personnelinfoGetpersonnelinfosbydevicecodes(data) {
    return request({
        url: 'personnelinfo/getpersonnelinfosbydevicecodes',
        method: 'post',
        data: data,
    });
}
/**
 * @description 下发人员名单信息
 * @param not
 * @return not
 * @author qiankui 2023-5-9 17:16:27
 **/
export function personnelinfoBatchsavedevicetpersonnels(data) {
    return request({
        url: 'personnelinfo/batchsavedevicetpersonnels',
        method: 'post',
        data: data,
    });
}
/**
 * @description 读取NFC卡信息
 * @param not
 * @return not
 * @author qiankui 2023-5-12 09:29:28
 **/
export function personnelinfoReadnfc() {
    return request({
        url: 'personnelinfo/readnfc',
        method: 'get'
    });
}
/**
 * @description 获取人员上传配置参数
 * @param not
 * @return not
 * @author qiankui 2023-5-18 17:18:27
 **/
export function personnelinfoGetpersoneldatauploadconfig() {
    return request({
        url: 'personnelinfo/getpersoneldatauploadconfig',
        method: 'get'
    });
}
/**
 * @description 设置人员上传配置参数
 * @param not
 * @return not
 * @author qiankui 2023-5-18 17:19:03
 **/
export function personnelinfoSetpersoneldatauploadconfig(data) {
    return request({
        url: 'personnelinfo/setpersoneldatauploadconfig',
        method: 'post',
        data: data,
    });
}
/**
 * @description jp2转base64，界面显示时使用，有损转换，保存时请使用/file/filetobase64进行无损转换
 * @param not
 * @return not
 * @author qiankui 2023-5-18 17:19:03
 **/
export function fileImageconverttobase64(filePath) {
    var  form = new FormData();
    form.append("filePath",filePath)
    return request({
        url: 'file/imageconverttobase64',
        method: 'post',
        data: form,
    });
}
